﻿@using GigaSite.Web.Models
@model IEnumerable<GigaSite.Web.Models.BusinessCardModel>
@{
    int itemsPerLine = ViewBag.itemsPerLine ?? 4;
    var cards = new List<BusinessCardModel>(Model);
}

<div class="bannerListHolder">
    @while (cards.Count > 0)
    {
        var lineCards = cards.Take(itemsPerLine).ToList();
        var cardsRendered = 0;
        <ul class="bannerList justify">
            @foreach(var card in lineCards)
            {
                cards.Remove(card);
                cardsRendered++;
                <li class="smallBanner">
                @Html.Partial("BusinessCard",card)
                </li>
            }
            @while(cardsRendered < itemsPerLine)
            {
                cardsRendered++;
                <li class="smallBanner">
                    <a href="#">
                        <div class="cardImage blankCardPlace">&nbsp;</div>
                    </a>
                </li>
            }
        </ul>
    }
</div>